import requestProxy from '@/utils/request';
const { request } = requestProxy;

// 签约审批tab列表
export function tabList(params) {
  return request({
    url: '/admin/signUp/tab',
    method: 'get',
    params
  });
}
// 签约审批列表
export function signUpList(params, cancelToken) {
  return request({
    url: '/admin/signUp/list',
    method: 'get',
    params,
    cancelToken
  });
}
// 删除签约列表元素
export function deleteSignUp(id) {
  return request({
    url: `/admin/signUp/delete/${id}`,
    method: 'delete'
  });
}
// 获取签约详情信息
export function signUpDetail(id, notValidate = false) {
  return request({
    url: `admin/signUp/detail/${id}`,
    method: 'get',
    params: { notValidate }
  });
}
// 评论列表
export function getsignUpComments(params) {
  return request({
    url: '/admin/signUp/comments/list',
    method: 'get',
    params
  });
}
// 发表评论
export function signUpCommentAdd(data) {
  return request({
    url: '/admin/signUp/comments/add',
    method: 'post',
    data
  });
}
// 签约审批-流程审批
export function signUpProcessAudit(data) {
  return request({
    url: '/admin/signUp/process/audit',
    method: 'post',
    data
  });
}
// 签约审批 - 流程 - 撤回
export function signUpProcessRecall(data) {
  return request({
    url: '/admin/signUp/process/recall',
    method: 'post',
    data
  });
}
// 签约审批 - 流程 - 撤销
export function signUpProcessRevocation(data) {
  return request({
    url: '/admin/signUp/process/revocation',
    method: 'post',
    data
  });
}

// 测试接口
export function getPlatformConfig(platformId) {
  return request({
    url: `/admin/platformField/${platformId}`,
    method: 'get'
  });
}

export function createSignUp(data) {
  return request({
    url: '/admin/signUp/create',
    method: 'post',
    data
  });
}
export function editSignUp(data) {
  return request({
    url: `/admin/signUp/edit/${data.id}`,
    method: 'put',
    data
  });
}
// 是否发起合同审批
export function hasCreatedContract(id) {
  return request({
    url: `admin/signUp/hasCreatedContract/${id}`,
    method: 'get'
  });
}
// 是否发起合同审批
export function editSignPoint(data) {
  return request({
    url: '/admin/signUp/edit/signPoint',
    method: 'put',
    data
  });
}
// 表单提交、获取审批流
export function formSubmit(data) {
  return request({
    url: '/admin/signUp/formSubmit',
    method: 'post',
    data
  });
}
// 账号自动续约状态编辑
export function editAccountRenewal(data) {
  return request({
    url: 'admin/signUp/accountRenewal/edit',
    method: 'post',
    data
  });
}
// 关联签约合同
export function associateContractRenewal(data) {
  return request({
    url: 'admin/signUp/contractRenewal/associate',
    method: 'post',
    data
  });
}
// 审批节点合同关联
export function associateAccountContract(data) {
  return request({
    url: 'admin/signUp/accountContract/associate',
    method: 'post',
    data
  });
}
// 同步资源判断
export function syncResource(id) {
  return request({
    url: `admin/signUp/resourceSync/${id}`,
    method: 'get'
  });
}
// 检验关联账号是否已同步
export function checkAccountSync(id) {
  return request({
    url: `/admin/signUp/accountSyncCheck?signUpId=${id}`,
    method: 'get'
  });
}
// 检验关联账号是否已同步
export function getSignUpCount(params) {
  return request({
    url: '/admin/signUp/list/statistics',
    method: 'get',
    params
  });
}
